import java.util.Date;

public class Main {
    public static void main(String[] args) {
        // 创建一个客户
        Customer customer = new Customer("John Doe", "1234567890", "123 Main St", true);

        // 创建商品
        Product product1 = new Product("Laptop", 2.5f, "A high-end laptop");
        Product product2 = new Product("Mouse", 0.2f, "Wireless mouse");

        // 创建订单详情并添加商品
        OrderDetail orderDetail = new OrderDetail(2); // 假设购买了两件商品
        orderDetail.addProduct(product1);
        orderDetail.addProduct(product2);

        // 创建支付方式
        Payment payment = new Credit(1000.0f, "1234-5678-9012-3456", "VISA", new Date());

        // 创建订单
        Order order = new Order(new Date(), Order.Status.CREATE, orderDetail, payment);

        // 将订单添加到客户
        customer.addOrder(order);

        // 打印订单信息
        System.out.println("订单小计: " + order.getOrderDetail().calculateSubTotal());
        System.out.println("订单总重量: " + order.getOrderDetail().calculateWeight());
    }
}
